{% extends "backend/base.html" %}

{% block mainbody %}
    <h3>
        商品信息管理
    </h3>
    <form id="edit-profile" action="{% url 'mybackend_goodsinsert' %}" class="form-horizontal" method="post" enctype="multipart/form-data">
        {% csrf_token %}
        <fieldset>
            <legend>添加商品信息</legend>
            <div class="control-group">
                <label class="control-label" for="input01">商品类别：</label>
                <div class="controls">
                    <select name="typeid">
                        {% for vo in types %}
                            <option
                                {% if vo.pgoodstype_id == 0 %}
                                    disabled
                                {% endif %}
                                 value="{{ vo.id }}">{{ vo.name }}</option>
                        {% endfor %}
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input01">商品名称：</label>
                <div class="controls">
                    <input type="text" name="goods" class="input-xlarge" id="input01"/>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input01">生产厂家：</label>
                <div class="controls">
                    <input type="text" name="company" class="input-xlarge" id="input01"/>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input01">单价：</label>
                <div class="controls">
                    <input type="text" name="price" class="input-xlarge" id="input01"/>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input01">库存量：</label>
                <div class="controls">
                    <input type="text" name="store" class="input-xlarge" id="input01"/>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input01">商品图片：</label>
                <div class="controls">
                    <input type="file" name="pic" class="input-xlarge" id="input01"/>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input01">商品简介：</label>
                <div class="controls">
                    <textarea style="overflow:scroll; max-height:300px" cols="40" style="width:450px" id="editor" rows="10" name="descr">
                    </textarea>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input01">商品状态：</label>
                <div>
                    <fieldset>
                        <select name="state">
                            <option value="0">
                                新上线
                            </option>
                            <option value="1">
                                在售
                            </option>
                            <option value="2">
                                已下线
                            </option>

                        </select>
                    </fieldset>
                </div>
            </div>
            <div class="form-actions">
                <button type="submit" class="btn btn-primary">添加</button> <button type="reset" class="btn">重置</button>
            </div>
        </fieldset>
    </form>

{% endblock %}